'use strict'
Object.defineProperty(exports, '__esModule', {value: true})
exports.send2 = exports.exchange = exports.transaction = undefined
var _site = require('./site.js')
var _site2 = _interopRequireDefault(_site)
var _jquery = require('jquery')
var _jquery2 = _interopRequireDefault(_jquery)
var _sha = require('sha1')
var _sha2 = _interopRequireDefault(_sha)
var _md = require('md5')
var _md2 = _interopRequireDefault(_md)
import sha1 from 'sha1';
import $ from 'jquery';
import site from './site.js'
import Vue from 'vue'
import IScroll from 'iscroll/build/iscroll-probe';
import md5 from 'md5';

function _interopRequireDefault (obj) {
  return obj && obj.__esModule ? obj : {default: obj}
}
//我的邀请数据
function getInvitation(ctx){
  var th = ctx;
  var info = {
    uid:localStorage.getItem("uid"),
    token:sha1(localStorage.getItem("uid") + "YX@#56.MM*77qwpyzmAXO")
  }
  $.ajax({
    type: "POST",
    url: "http://"+site+"/index/Wallet/myInvitation",
    data: info ,
    dataType:"json",
    success(data,status){
      th.display =true
      th.yqinfo = data.data;
    }
  })
};

function getEarnings(ctx){
  var th = ctx;
  var info = {
    uid:localStorage.getItem("uid"),
    token:sha1(localStorage.getItem("uid") +
      "YX@#56.MM*77qwpyzmAXO")
  }
  $.ajax({
    type: "POST",
    url: "http://"+site+"/index/Wallet/walletProfit",
    data: info ,
    dataType:"json",
    complete:function(xhr,status){
      th.display = true;
      setTimeout(function(){
        var myscroll=new IScroll("#wrapper",{
          click:th.iScrollClick(),
          scrollbars: true,
          mouseWheel: false,
          probeType:2,
          scrollbars: 'custom',
          fadeScrollbars:true,
          shrinkScrollbars:'clip'
        });

        document.addEventListener('touchmove', function(e) {
          e.preventDefault();
        }, {passive:false,capture:false})

        myscroll.on("scroll",function(){
          if(this.y <= this.maxScrollY && th.list.length > 10){
            th.scroll.display= true;
            if(th.scroll.loadtext == th.$t('m.scroll.nomore')){
              return false
            }else if(this.y < (this.maxScrollY - 30) && th.scroll.loadtext != th.$t('m.scroll.nomore')){
              th.scroll.loadtext = th.$t('m.scroll.loosen');
            }else{
              th.scroll.loadtext = th.$t('m.scroll.up');
            }
          }else{
            return false
          }
        });

        myscroll.on("scrollEnd",function(){
          if(th.scroll.loadtext == th.$t('m.scroll.loosen')){
            var page = ++th.scroll.page;
            var info = {
              uid:localStorage.getItem("uid"),
              page:page,
              token:sha1(localStorage.getItem("uid") + page + "YX@#56.MM*77qwpyzmAXO"),
            };
            var is = this;
            $.ajax({
              type: "POST",
              url: "http://"+site+"/index/Wallet/walletProfit",
              data: info ,
              dataType:"json",
              success:function(data,status){
                if(data.code==1){
                  data.data.jilu.forEach((v,k) => {
                    v.create_time = new Date(v.create_time*1000).toLocaleDateString().replace(/[\/年月日]/g,"-")+" "+new Date(v.create_time*1000).toLocaleTimeString("en-GB");
                    th.list.push(v);
                  });
                  th.scroll.display = false;
                  th.scroll.loadtext = th.$t('m.scroll.up');
                  setTimeout(function(){
                    is.refresh()
                  },0);
                }else if(data.code !==1){
                  th.scroll.loadtext = th.$t('m.scroll.nomore');
                }
              },
            });
          }else{
            th.scroll.display = false;
          }
        })
      },300);
    },
    success:function(data,status){
      if(status=="success"){
        switch(data.code){
          case 1:
            th.assetsData.valid = data.data.sumtoken;
            th.assetsData.total = data.data.sum_calculated;
            data.data.jilu.forEach((v,k) => {
              v.create_time = new Date(v.create_time*1000).toLocaleDateString().replace(/[\/年月日]/g,"-")+" "+new Date(v.create_time*1000).toLocaleTimeString("en-GB");
              th.list.push(v);
            });
            break;
          case "01":
            th.msg= th.$t('m.tips.exRecord["01"]');
            break;
          case "02":
            th.msg= th.$t('m.tips.exRecord["02"]');
            break;
          case "03":
            th.msg= th.$t('m.tips.exRecord["03"]');
            break;
        }
      }else{
        th.msg=th.$t('m.tips.timeout');
      }
    },
    error(status,error){
      if(error){
        th.msg=th.$t('m.tips.error');
      }
    },
    beforeSend:function(){
      th.display = false;
    }
  })
};

function resetpwd(ctx){
  var th = ctx;
  if(ctx.regxuser.test(ctx.list[0].info)     &&
    ctx.list[1].info != ""     &&
    ctx.regxpwd.test(ctx.list[2].info)	   &&
    ctx.regxpwd.test(ctx.list[3].info)	   &&
    ctx.regxpwd.test(ctx.list[4].info)	   &&
    ctx.regxpwd.test(ctx.list[5].info)	   &&
    ctx.list[2].info == ctx.list[3].info   &&
    ctx.list[4].info == ctx.list[5].info){
    var info = {
      tel:ctx.list[0].info,
      smscode:ctx.list[1].info,
      password:md5(ctx.list[2].info),
      repassword:md5(ctx.list[3].info),
      tradepwd:md5(ctx.list[4].info),
      retradepwd:md5(ctx.list[5].info),
      token:sha1(ctx.list[0].info +
        ctx.list[1].info   +
        md5(ctx.list[2].info)   +
        md5(ctx.list[3].info)   +
        md5(ctx.list[4].info)   +
        md5(ctx.list[5].info)   +
        "YX@#56.MM*77qwpyzmAXO")

    };
    $.ajax({
      type: "POST",
      url: "http://"+site+"/index/Reg/resetpwd",
      data: info ,
      dataType:"json",
      complete:function(xhr,status){
        plus.nativeUI.closeWaiting();
      },
      success:function(data,status){
        if(status=="success"){
          switch(data.code){
            case 1:
              th.msg= th.$t('m.tips.resetpwd["1"]');
              setTimeout(function(){
                th.$router.push({path:'/'});
              },200);
              break;
            case "01":
              th.msg= th.$t('m.tips.regist["01"]');
              break;
            case "10":
              th.msg= th.$t('m.tips.resetpwd["2"]');
              break;
            case "11":
              th.msg= th.$t('m.tips.regist["10"]');
              break;
            case "05":
              th.msg= th.$t('m.tips.regist["05"]');
              break;
            case "07":
              th.msg= th.$t('m.tips.resetpwd["3"]');
              break;
            case "12":
              th.msg= th.$t('m.tips.regist["12"]');
              break;
          }
        }else{
          th.msg = th.$t('m.tips.timeout');
        }
      },
      error(status,error){
        if(error){
          th.msg=th.$t('m.tips.error');
        }
      },
      beforeSend:function(){
        //plus.nativeUI.showWaiting(th.$t('m.tips.regist["09"]'),{verticalAlign:"center"});
      }
    });
  }else if(ctx.list[0].info == ""){
    th.msg= th.$t('m.tips.regist["10"]');
  }else if(ctx.list[1].info == ""){
    th.msg= th.$t('m.tips.regist["11"]');
  }else if(ctx.list[2].info != ctx.list[3].info){
    th.msg= th.$t('m.tips.regist["05"]');
  }else if(ctx.list[4].info != ctx.list[5].info){
    th.msg= th.$t('m.tips.regist["16"]');
  }else{
    th.msg= th.$t('m.tips.regist["0A"]');
  }
};

//注册
function regist(ctx){
  var th = ctx;
  if(ctx.regxuser.test(ctx.list[0].info)     &&
    ctx.regxpwd.test(ctx.list[2].info)     &&
    ctx.regxpwd.test(ctx.list[3].info)     &&
    ctx.list[2].info == ctx.list[3].info   &&
    ctx.regxpwd.test(ctx.list[4].info)	   &&
    ctx.regxpwd.test(ctx.list[5].info)	   &&
    ctx.list[4].info == ctx.list[5].info   &&
    ctx.list[0].info != ""     &&
    ctx.list[1].info != ""     &&
    ctx.list[6].info != ""){
    var info = {
      tel:ctx.list[0].info,
      smscode:ctx.list[1].info,
      password:md5(ctx.list[2].info),
      repassword:md5(ctx.list[3].info),
      tradepassword:md5(ctx.list[4].info),
      retradepassword:md5(ctx.list[5].info),
      yqcode:ctx.list[6].info,
      token:sha1(ctx.list[0].info +
        ctx.list[1].info        +
        md5(ctx.list[2].info)   +
        md5(ctx.list[3].info)   +
        md5(ctx.list[4].info)   +
        md5(ctx.list[5].info)   +
        ctx.list[6].info        +
        "YX@#56.MM*77qwpyzmAXO")

    };
    $.ajax({
      type: "POST",
      url: "http://"+site+"/index/Reg/reg",
      data: info ,
      dataType:"json",
      complete:function(xhr,status){
        plus.nativeUI.closeWaiting();
      },
      success:function(data,status){
        if(status=="success"){
          switch(data.code){
            case 1:
              th.msg= th.$t('m.tips.regist["1"]');
              setTimeout(function(){
                th.$router.push({path:'/'});
              },200);
              break;
            case "01":
              th.msg= th.$t('m.tips.regist["01"]');
              break;
            case "02":
              th.msg= th.$t('m.tips.regist["02"]');
              break;
            case "03":
              th.msg= th.$t('m.tips.regist["03"]');
              break;
            case "04":
              th.msg= th.$t('m.tips.regist["04"]');
              break;
            case "05":
              th.msg= th.$t('m.tips.regist["05"]');
              break;
            case "06":
              th.msg= th.$t('m.tips.regist["06"]');
              break;
            case "07":
              th.msg= th.$t('m.tips.regist["07"]');
              break;
            case "08":
              th.msg= th.$t('m.tips.regist["08"]');
              break;
            case "12":
              th.msg= th.$t('m.tips.regist["12"]');
              break;
            case "13":
              th.msg= th.$t('m.tips.regist["16"]');
              break;
          }
        }else{
          th.msg = th.$t('m.tips.timeout');
        }
      },
      error(status,error){
        if(error){
          th.msg=th.$t('m.tips.error');
        }
      },
      beforeSend:function(){
        //plus.nativeUI.showWaiting(th.$t('m.tips.regist["09"]'),{verticalAlign:"center"});
      }
    });
  }else if(ctx.list[7].info == ""){
    th.msg= th.$t('m.tips.regist["02"]');
  }else if(ctx.list[1].info != ctx.list[2].info){
    th.msg= th.$t('m.tips.regist["05"]');
  }else if(ctx.list[3].info != ctx.list[4].info){
    th.msg= th.$t('m.tips.regist["16"]');
  }else if(ctx.list[5].info == ""){
    th.msg= th.$t('m.tips.regist["10"]');
  }else if(ctx.list[6].info == ""){
    th.msg= th.$t('m.tips.regist["11"]');
  }else{
    th.msg= th.$t('m.tips.regist["0A"]');
  }
};

const send = {
  //验证发送地址是否有效
  nextStep(ctx){
    var th = ctx;
    var info = {
      uid:localStorage.getItem("uid"),
      address:th.list[0].info,
      token:sha1(localStorage.getItem("uid") + th.list[0].info + "YX@#56.MM*77qwpyzmAXO")
    };
    $.ajax({
      type: "POST",
      url: "http://"+site+"/index/Transferaccounts/isAddress",
      data: info ,
      dataType:"json",
      complete:function(xhr,status){
        // plus.nativeUI.closeWaiting();
      },
      success:function(data,status){
        if(status=="success"){
          switch(data.code){
            case 1:
              th.$router.push({path:"/send2?path=send&&address="+th.list[0].info+"&isInside="+data.data});
              break;
            case "01":
              th.msg= th.$t('m.tips.send1["01"]');
              break;
            case "02":
              th.msg= th.$t('m.tips.send1["02"]');
              break;
            case "03":
              th.msg= th.$t('m.tips.send1["03"]');
              break;
            case "04":
              th.msg= th.$t('m.tips.send1["04"]');
              break;
            case "05":
              th.msg= th.$t('m.tips.send1["05"]');
              break;
          }
        }else{
          th.msg=th.$t('m.tips.timeout');
        }
      },
      error(status,error){
        if(error){
          th.msg=th.$t('m.tips.error');
        }
      },
      beforeSend:function(){
        // plus.nativeUI.showWaiting();
      }
    })
  },

  //获取个人的币和能量数据
  fetchAssets(ctx){
    var th = ctx;
    const info = {
      uid:localStorage.getItem("uid"),
      address:ctx.$route.query.address,
      token:sha1(localStorage.getItem("uid") + ctx.$route.query.address + "YX@#56.MM*77qwpyzmAXO")
    };
    $.ajax({
      type: "POST",
      url: "http://"+site+"/index/Transferaccounts/userAccountsInfo",
      data: info ,
      dataType:"json",
      complete:function(xhr,status){
      },
      success:function(data,status){
        if(status=="success"){
          console.log(data)
          switch(data.code){
            case 1:
              th.assetsData.coin = data.data.token_over;
              th.assetsData.ratio = Number(data.data.rate_outli);
              th.assetsData.isInside = data.data.isInside;
              th.tel = data.data.phone;
              break;
            case "01":
              th.msg= th.$t('m.tips.send2["01"]');
              break;
            case "02":
              th.msg= th.$t('m.tips.send2["02"]');
              break;
            case "03":
              th.msg= th.$t('m.tips.send2["03"]');
              break;
          }
        }else{
          th.msg=th.$t('m.tips.timeout');
        }
      },
      error(status,error){
        if(error){
          th.msg=th.$t('m.tips.error');
        }
      }
    })
  },

  //确认发送币，递交表单
  sendCoin(ctx,amount){
    var th = ctx;
    var smscode = $(".smscode").val();
    console.log(smscode);
    var info = {
      uid:localStorage.getItem("uid"),
      address:ctx.$route.query.address,
      number:amount,
      pwdtrade:md5(ctx.list[1].info),
      smscode:smscode,
      token:sha1(localStorage.getItem("uid") +
        ctx.$route.query.address          +
        amount 				   			   +
        md5(ctx.list[1].info)             +
        smscode	+
        "YX@#56.MM*77qwpyzmAXO")
    };
    $.ajax({
      type: "POST",
      url: "http://"+site+"/index/Transferaccounts/transferAccounts",
      data: info ,
      dataType:"json",
      complete:function(xhr,status){
        // plus.nativeUI.closeWaiting();
      },
      success:function(data,status){
        if(status=="success"){
          switch(data.code){
            case 1:
              th.assetsData.coin -= amount;
              $("[name='coin_amount']").val("");
              th.assetsData.balance = th.assetsData.balance - Number(th.energy);
              th.list[1].info = "";
              th.energy = 0;
              th.msg= th.$t('m.tips.send3["1"]');
              break;
            case "01":
              th.msg= th.$t('m.tips.send3["01"]');
              break;
            case "02":
              th.msg= th.$t('m.tips.send3["02"]');
              break;
            case "03":
              th.msg= th.$t('m.tips.send3["03"]');
              break;
            case "04":
              th.msg= th.$t('m.tips.send3["04"]');
              break;
            case "05":
              th.msg= th.$t('m.tips.send3["05"]');
              break;
            case "06":
              th.msg= th.$t('m.tips.send3["06"]');
              break;
            case "07":
              th.msg= th.$t('m.tips.send3["07"]');
              break;
            case "08":
              th.msg= th.$t('m.tips.send3["08"]');
              break;
            case "09":
              th.msg= th.$t('m.tips.send3["09"]');
              break;
            case "0A":
              th.msg= th.$t('m.tips.send3["0A"]');
              break;
            case "0B":
              th.msg= th.$t('m.tips.send3["0B"]');
              break;
            case "0C":
              th.msg= th.$t('m.tips.send3["0C"]');
              break;
            case "0D":
              th.msg= th.$t('m.tips.send3["0D"]');
              break;
            case "12":
              th.msg= th.$t('m.tips.regist["12"]');
              break;
          }
        }else{
          th.msg=th.$t('m.tips.timeout');
        }
      },
      error(status,error){
        if(error){
          th.msg=th.$t('m.tips.error');
        }
      },
      beforeSend:function(){
        // plus.nativeUI.showWaiting();
      }
    })
  }
};

//我的邀请列表
function getInvitList(ctx,yqcode,uid){
  var th = ctx;
  var info = {
    yqcode:yqcode,
    token:sha1(yqcode + "YX@#56.MM*77qwpyzmAXO")
  }
  var dataVal = $(".list_"+uid).attr('data-value');
  if (dataVal == 1) {
    $.ajax({
      type: "POST",
      url: "http://"+site+"/index/Wallet/getInvitList",
      data: info ,
      dataType:"json",
      success(data,status){
        if(data.data){
          var addstr = '<ul class="childLevel'+yqcode+'" style="margin-left:20px;margin-top:0px;">';
          $.each(data.data, function (idx, obj) {
            // if(obj.is_buy == 1){
            //   var node_name = "已投资";
            // }else{
            //   var node_name = "未投资";
            // }
            // addstr += '<li data-value="1" class="list_'+obj.uid+'" v-on:click="showInvitList(\'' + obj.yqcode + '\',\'' + obj.uid + '\')"><span class="operaSign">+</span> '+obj.user+'('+node_name+')</li>';
            addstr += '<li data-value="1" class="list_'+obj.uid+'" v-on:click="showInvitList(\'' + obj.yqcode + '\',\'' + obj.uid + '\')"><span class="operaSign">+</span> '+obj.phone+'</li>';
          });
          addstr += '</ul>';
          var MyComponent=Vue.extend({
            template: addstr,
            methods:{
              showInvitList(yqcode,uid){
                getInvitList(this,yqcode,uid);
              }
            }
          });
          var component = new MyComponent().$mount();
          $(".list_"+uid).after(component.$el);
          $(".list_"+uid).attr('data-value','0');
          $(".list_"+uid+" span").html("-");
        }
      }
    })
  }else{
    $(".childLevel"+yqcode).remove();
    $(".list_"+uid).attr('data-value','1');
    $(".list_"+uid+" span").html("+");
  }
};
var transaction = function transaction (ctx) {
  var th = ctx
  var info = {
    uid: localStorage.getItem('uid'),
    token: (0, _sha2.default)(localStorage.getItem('uid') + 'YX@#56.MM*77qwpyzmAXO')
  }
  _jquery2.default.ajax({
    type: 'POST',
    url: 'http://' + _site2.default + '/index/Transaction/transaction',
    data: info,
    dataType: 'json',
    complete: function complete (xhr, status) {
      th.display = true
    },
    success: function success (data, status) {
      if (status == 'success') {
        console.log(data)
        switch (data.code) {
          case 1:
            th.finance.total = data.data.sumtoken
            th.finance.token_over = data.data.token_over
            th.finance.yqcode = data.data.yqcode
            break
          case'01':
            th.msg = th.$t('m.tips.trans["01"]')
            break
          case'02':
            th.msg = th.$t('m.tips.trans["02"]')
            break
        }
      } else {
        th.msg = th.$t('m.tips.timeout')
      }
    },
    error: function error (status, _error) {
      if (_error) {
        th.msg = th.$t('m.tips.error')
      }
    },
    beforeSend: function beforeSend () {
      th.display = false
    }
  })
}
var exchange = {
  getInfo: function getInfo (ctx) {
    var th = ctx
    var info = {
      uid: localStorage.getItem('uid'),
      token: (0, _sha2.default)(localStorage.getItem('uid') + 'YX@#56.MM*77qwpyzmAXO')
    }
    _jquery2.default.ajax({
      type: 'POST',
      url: 'http://' + _site2.default + '/index/TransferAccounts/exchangeOfEnergy',
      data: info,
      dataType: 'json',
      complete: function complete (xhr, status) {
      },
      success: function success (data, status) {
        if (status == 'success') {
          switch (data.code) {
            case 1:
              th.assetsData.coin = data.data.token_over
              th.assetsData.energy = data.data.energy
              th.assetsData.ratio = data.data.energy_ratio
              break
            case'01':
              th.msg = th.$t('m.tips.exchange1["01"]')
              break
            case'02':
              th.msg = th.$t('m.tips.exchange1["02"]')
              break
          }
        } else {
          th.msg = th.$t('m.tips.timeout')
        }
      },
      error: function error (status, _error2) {
        if (_error2) {
          th.msg = th.$t('m.tips.error')
        }
      }
    })
  }, exMethod: function exMethod (ctx) {
    var th = ctx
    var amount = (0, _jquery2.default)('[name=\'amount\']').val()
    var info = {
      number: amount,
      pwdtrade: (0, _md2.default)(ctx.list[1].info),
      uid: localStorage.getItem('uid'),
      token: (0, _sha2.default)(amount + (0, _md2.default)(ctx.list[1].info) + localStorage.getItem('uid') + 'YX@#56.MM*77qwpyzmAXO')
    }
    _jquery2.default.ajax({
      type: 'POST',
      url: 'http://' + _site2.default + '/index/TransferAccounts/subExchangeOfEnergy',
      data: info,
      dataType: 'json',
      complete: function complete (xhr, status) {
        plus.nativeUI.closeWaiting()
      },
      success: function success (data, status) {
        if (status == 'success') {
          console.log(data)
          switch (data.code) {
            case 1:
              th.assetsData.coin -= amount
              th.assetsData.energy = Number(th.assetsData.energy) + Number(amount) * th.assetsData.ratio;
              (0, _jquery2.default)('[name=\'amount\']').val('')
              th.energy = 0
              th.list[1].info = ''
              th.msg = th.$t('m.tips.exchange2["1"]')
              break
            case'01':
              th.msg = th.$t('m.tips.exchange2["01"]')
              break
            case'02':
              th.msg = th.$t('m.tips.exchange2["02"]')
              break
            case'03':
              th.msg = th.$t('m.tips.exchange2["03"]')
              break
            case'04':
              th.msg = th.$t('m.tips.exchange2["04"]')
              break
            case'05':
              th.msg = th.$t('m.tips.exchange2["05"]')
              break
            case'06':
              th.msg = th.$t('m.tips.exchange2["06"]')
              break
            case'07':
              th.msg = th.$t('m.tips.exchange2["07"]')
              break
            case'08':
              th.msg = th.$t('m.tips.exchange2["08"]')
              break
          }
        } else {
          th.msg = th.$t('m.tips.timeout')
        }
      },
      error: function error (status, _error3) {
        if (_error3) {
          th.msg = th.$t('m.tips.error')
        }
      },
      beforeSend: function beforeSend () {
        plus.nativeUI.showWaiting()
      }
    })
  }
}
var send2 = {
  getInfo: function getInfo (ctx) {
    var th = ctx
    var info = {
      uid: localStorage.getItem('uid'),
      address: th.$route.query.address,
      token: (0, _sha2.default)(localStorage.getItem('uid') + th.$route.query.address + 'YX@#56.MM*77qwpyzmAXO')
    }
    _jquery2.default.ajax({
      type: 'POST',
      url: 'http://' + _site2.default + '/index/Transferaccounts/userAccountsInfo',
      data: info,
      dataType: 'json',
      complete: function complete (xhr, status) {
      },
      success: function success (data, status) {
        if (status == 'success') {
          console.log(data)
          switch (data.code) {
            case 1:
              th.assetsData.coin = data.data.token_over
              th.assetsData.ratio = data.data.rate_outli
              th.assetsData.balance = parseInt(data.data.energy)
              th.balance = parseInt(data.data.energy)
              break
            case'01':
              th.msg = th.$t('m.tips.send2["01"]')
              break
            case'02':
              th.msg = th.$t('m.tips.send2["02"]')
              break
            case'03':
              th.msg = th.$t('m.tips.send2["03"]')
              break
          }
        } else {
          th.msg = th.$t('m.tips.timeout')
        }
      },
      error: function error (status, _error4) {
        if (_error4) {
          th.msg = th.$t('m.tips.error')
        }
      }
    })
  }, sendMethod: function sendMethod (ctx, amount) {
    var th = ctx
    var info = {
      uid: localStorage.getItem('uid'),
      address: th.$route.query.address,
      number: amount,
      pwdtrade: (0, _md2.default)(th.list[1].info),
      token: (0, _sha2.default)(localStorage.getItem('uid') + th.$route.query.address + amount + (0, _md2.default)(th.list[1].info) + 'YX@#56.MM*77qwpyzmAXO')
    }
    _jquery2.default.ajax({
      type: 'POST',
      url: 'http://' + _site2.default + '/index/Transferaccounts/transferAccounts',
      data: info,
      dataType: 'json',
      complete: function complete (xhr, status) {
        plus.nativeUI.closeWaiting()
      },
      success: function success (data, status) {
        if (status == 'success') {
          switch (data.code) {
            case 1:
              th.assetsData.coin -= amount;
              (0, _jquery2.default)('[name=\'coin_amount\']').val('')
              th.assetsData.balance = th.assetsData.balance - Number(th.energy)
              th.list[1].info = ''
              th.energy = 0
              th.msg = th.$t('m.tips.send3["1"]')
              break
            case'01':
              th.msg = th.$t('m.tips.send3["01"]')
              break
            case'02':
              th.msg = th.$t('m.tips.send3["02"]')
              break
            case'03':
              th.msg = th.$t('m.tips.send3["03"]')
              break
            case'04':
              th.msg = th.$t('m.tips.send3["04"]')
              break
            case'05':
              th.msg = th.$t('m.tips.send3["05"]')
              break
            case'06':
              th.msg = th.$t('m.tips.send3["06"]')
              break
            case'07':
              th.msg = th.$t('m.tips.send3["07"]')
              break
            case'08':
              th.msg = th.$t('m.tips.send3["08"]')
              break
            case'09':
              th.msg = th.$t('m.tips.send3["09"]')
              break
            case'0A':
              th.msg = th.$t('m.tips.send3["0A"]')
              break
            case'0B':
              th.msg = th.$t('m.tips.send3["0B"]')
              break
            case'0C':
              th.msg = th.$t('m.tips.send3["0C"]')
              break
            case'0D':
              th.msg = th.$t('m.tips.send3["0D"]')
              break
          }
        } else {
          th.msg = th.$t('m.tips.timeout')
        }
      },
      error: function error (status, _error5) {
        if (_error5) {
          th.msg = th.$t('m.tips.error')
        }
      },
      beforeSend: function beforeSend () {
        // plus.nativeUI.showWaiting()
      }
    })
  }
}
export {
  getInvitList,
  getInvitation,
  getEarnings,
  regist,
  resetpwd,
  send,
};
exports.transaction = transaction
// exports.getInvitList = getInvitList
exports.exchange = exchange
exports.send2 = send2
